package org.xxpay.pay.channel.xinanali;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.Assert;
import org.xxpay.common.unify.AbstractPaymentConfig;

public class XinanaliConfig extends AbstractPaymentConfig {
    public static final String CHANNEL_NAME = "xinanali";

    public static final String RETURN_VALUE_SUCCESS = "0";
    public static final String RESPONSE_RESULT_FAIL = "fail";       // 返回上游失败
    public static final String RESPONSE_RESULT_OK = "SUCCESS"; // 返回上游成功

    public static final String REQ_PAY_URL_FIXX = ":89/Home/Open/AliH5Pay";
    public static final String REQ_PAY_QUERY_URL_FIXX = ":89/Home/Open/qry";


    XinanaliConfig(String payParam){
        Assert.notNull(payParam, "init quanmin config error");
        JSONObject object = JSON.parseObject(payParam);
        setAppId(object.getString("appId"));
        setMchId(object.getString("mchId"));
        setPrivateKey(object.getString("privateKey"));
        setRequestUrl(object.getString("requestUrl"));
        setPublicKey(object.getString("publickey"));
    }
}
